]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Only enable automatically if ClutterSeat::touch-mode is enabled
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 10 Feb 2020 19:03:30 +0000 (20:03 +0100)
committerCarlos Garnacho <mrgarnacho@gmail.com>
Mon, 10 Feb 2020 22:07:19 +0000 (22:07 +0000)
This defers the policy on backends about whether it makes sense to show
the OSK.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/872
js/ui/keyboard.js

index 875cb702f73572a9adaf668d47aaa344726f77c7..868a4b3d3643a082d2238589a5bf1eedad75e70d 100644 (file)
@@ -1102,6 +1102,9 @@ var KeyboardManager = class KeyBoardManager {
         this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA });
         this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
 
+        this._seat = Clutter.get_default_backend().get_default_seat();
+        this._seat.connect('notify::touch-mode', this._syncEnabled.bind(this));
+
         this._lastDevice = null;
         Meta.get_backend().connect('last-device-changed', (backend, device) => {
             if (device.get_device_name().indexOf('XTEST') < 0) {
@@ -1122,7 +1125,9 @@ var KeyboardManager = class KeyBoardManager {
 
     _syncEnabled() {
         let enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
-        let enabled = enableKeyboard || this._lastDeviceIsTouchscreen();
+        let autoEnabled = this._seat.get_touch_mode() && this._lastDeviceIsTouchscreen();
+        let enabled = enableKeyboard || autoEnabled;
+
         if (!enabled && !this._keyboard)
             return;